import { actionCreator } from '../utils/func'
import {
  PUSH,
  POP,
  LOGIN,
  USER_LOGOUT,
  RESET,
  RESET_SECOND
} from '../constants/actionType'

export function push (page, params) {
  return actionCreator({
    type: PUSH,
    payload: { page, params }
  })
}
export function pop (params) {
  return actionCreator({
    type: POP,
    payload: { params }
  })
}
export function login (params) {
  return actionCreator({
    type: LOGIN,
    payload: { params }
  })
}
export function logout (params) {
  return actionCreator({
    type: USER_LOGOUT,
    payload: { params }
  })
}
export function reset (page, params) {
  return actionCreator({
    type: RESET,
    payload: { page, params }
  })
}
export function resetSecond (pageOne, pageTwo, params) {
  return actionCreator({
    type: RESET_SECOND,
    payload: { pageOne, pageTwo, params }
  })
}
